package com.newu.lh.databinding;

import android.databinding.DataBindingUtil;
import android.databinding.ViewDataBinding;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.Adapter;

import com.newu.lh.databinding.databinding.ActivityMainBinding;

import java.util.ArrayList;

public class MainActivity extends AppCompatActivity {

    private ArrayList<Bean> list;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        ActivityMainBinding mainBinding = DataBindingUtil.setContentView(this, R.layout.activity_main);
        initList();
        mainBinding.lv.setAdapter(new MAdapter(this, list));
    }

    private void initList() {
        list = new ArrayList<>();
        list.add(new Bean("1"));
        list.add(new Bean("1"));
        list.add(new Bean("1"));
        list.add(new Bean("1"));
        list.add(new Bean("1"));
        list.add(new Bean("1"));
    }
}
